#include <iostream>
#include <irrlicht.h>
#include <strings.h>
#include "Irr2D.h"
#include "IrrSprite.h"
using
namespace
irr;
using
namespace
core;
using
namespace
scene;
using
namespace
video;
using
namespace
io;
using
namespace
gui;
using
namespace
std;
Irr2D::Irr2D(){
this
->numTextures = 0;
}
Irr2D::~Irr2D(){
for
(
int
i = 0; i < numTextures; ++i)
delete
this
->textures[i];
delete
this
->textures;
}
void
Irr2D::SetSmgr(irr::scene::ISceneManager* smgr){
this
->smgr = smgr;
Sprite.SetSmgr(smgr);
}
void
Irr2D::SetDriver(irr::video::IVideoDriver* driver){
this
->driver = driver;
Sprite.SetDriver(driver);
}
void
Irr2D::LoadTexturemap(std::string file){
this
->texturemap = driver->getTexture(file.c_str());
}
int
Irr2D::LoadTexture(std::string file){
this
->textures[
this
->numTextures] = driver->getTexture(file.c_str());
this
->numTextures++;
return
numTextures--;
}